home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / cmln1085.arc / ALTER.ART < prev    next >
Text File  |  1986-02-27  |  14KB  |  292 lines

  1. FORT╚ i≤ sometime≤ saiΣ t∩ bσ it≤ owε operatinτ system¼ anΣ therσ ì
  2. arσ certainl∙ system≤ wherσ thi≤ i≤ true«  However¼ microcompute≥ ì
  3. user≤ morσ ofteε ruε FORT╚ unde≥ anothe≥ operatinτ systeφ sucΦ a≤ ì
  4. CP/═ o≥ MSDOS¼á anΣ thσ relationshi≡ i≤ no⌠ alway≤ a≤ happ∙ a≤ i⌠ ì
  5. migh⌠á be«á  Onσ majo≥ conflic⌠ i≤ tha⌠ FORT╚ divide≤ disδá spacσ ì
  6. int∩ uniforφ ▒ kilobytσ screens¼á whilσ thσ hos⌠ operatinτ systeφ ì
  7. use≤á variablσá lengtΦ files«á  Sincσ FORT╚ doe≤ no⌠ respec⌠á thσ ì
  8. operatinτá systeφá disδá directory¼á i⌠ i≤á difficul⌠á fo≥á FORT╚ ì
  9. screen≤ anΣ file≤ t∩ coexis⌠ oε thσ samσ disk.
  10.  
  11. Thσ probleφ get≤ worsσ becausσ commonl∙ availablσ screeεá editor≤ ì
  12. arσ designeΣ t∩ handlσ file≤ rathe≥ thaε FORT╚ screens«  Ordinar∙ ì
  13. file≤á arσá madσá u≡á oµ variablσ lengtΦá line≤á separateΣá b∙á ß ì
  14. carriagσ return/linσ feeΣ pai≥ o≥ somσ simila≥ convention¼á whilσ ì
  15. FORT╚á screen≤ arσ usuall∙ divideΣ int∩ 1╢ fixeΣ lengtΦ line≤á oµ ì
  16. 6┤á characters¼á anΣ looδ likσ gibberisΦ t∩ ß filσ editor«á  Somσ ì
  17. commercia∞ version≤ oµ FORT╚ arσ no≈ beinτ provideΣ witΦ suitablσ ì
  18. screeε editor≤ t∩ solvσ thi≤ problem.
  19.  
  20. ╔á worδ witΦ thσ publiπ domaiε versioε oµ FORT╚ 7╣ froφá Mountaiε ì
  21. Vie≈á Press«á  Thi≤ camσ witΦ ß linσ edito≥ tha⌠á work≤á directl∙ ì
  22. froφá thσá FORT╚ commanΣ level¼á s∩ tha⌠ editinτ command≤ caεá bσ ì
  23. intersperseΣ witΦ othe≥ FORT╚ words«á  Unfortunately¼ ╔ finΣ thi≤ ì
  24. edito≥á slo≈á anΣá frustratinτ iε comparisoεá t∩á ßá ful∞á screeε ì
  25. editor«á  Whilσá somσá FORT╚ screeε editor≤ arσ availablσ iεá thσ ì
  26. publiπ domain¼á thei≥ command≤ var∙ froφ thosσ oµá WordStar¼á thσ ì
  27. screeεá edito≥á tha⌠ ╔ usσ mos⌠ often«á  ╔ decideΣ tha⌠á ╔á woulΣ ì
  28. rathe≥ learε t∩ writσ aε edito≥ thaε learε ß ne≈ syntax¼á anΣ thσ ì
  29. resul⌠á wa≤ ALTER--ß FORT╚ screeε edito≥ witΦ WordSta≥ work-alikσ ì
  30. commands.
  31.  
  32. USING ALTER
  33.  
  34. Ho≈á doe≤ ALTE╥ work┐á  Oncσ thσ word≤ ALTE╥ anΣ A╠ arσá iεá you≥ ì
  35. FORT╚á dictionary¼á yo⌡á invokσá thσ edito≥ b∙ typinτá SCR▒á SCR▓ ì
  36. ALTER¼ wherσ SCR▒ anΣ SCR▓ arσ thσ firs⌠ anΣ las⌠ FORT╚ block≤ iε ì
  37. thσá rangσ yo⌡ wil∞ bσ editing«á  ALTE╥ no≈ begin≤á trappinτá al∞ ì
  38. keyboarΣ input¼ whicΦ i⌠ interpret≤ eithe≥ a≤ editinτ command≤ o≥ ì
  39. character≤á t∩ bσ addeΣ t∩ thσ curren⌠ screen«á  Yo⌡ arσ onσ ste≡ ì
  40. awa∙ froφ thσ FORT╚ commanΣ level¼á s∩ othe≥ FORT╚ word≤ arσá no⌠ ì
  41. directl∙ accessible«á  However¼ thσ worΣ A╠ make≤ i⌠ eas∙ t∩ movσ ì
  42. iεá anΣá ou⌠á oµ thσ editor«á  Afte≥ yo⌡ exi⌠á witΦá thσá contro∞ ì
  43. sequencσ ^KD¼á typinτ A╠ witΦ nothinτ oε thσ stacδ wil∞ returε t∩ ì
  44. editinτ thσ screeε froφ whicΦ yo⌡ exited.
  45.  
  46. ALTE╥á provide≤á thσ feature≤ oµ ful∞ screeε editor≤ tha⌠ ╔á finΣ ì
  47. usefu∞ fo≥ writinτ FORT╚ programs¼á bu⌠ omit≤ thσá frills«á  Thi≤ ì
  48. mean≤á tha⌠á freσá curso≥ movement¼á tex⌠ entry/deletioεá a⌠á thσ ì
  49. cursor¼á insert/overwritσ modes¼ search/replace¼ blocδ operation≤ ì
  50. anΣ macro≤ arσ available¼ whilσ formattinτ anΣ prin⌠ command≤ arσ ì
  51. omitted.
  52.  
  53. Mos⌠ command≤ fo≥ curso≥ movement¼á tex⌠ entry¼á anΣ deletioε arσ ì
  54. thσá samσ a≤ iε WordStar«á  Wheε aε adaptatioε t∩ FORT╚ wa≤á ver∙ ì
  55. obviou≤á (e.g«á makinτá ^├á anΣ ^╥ movσ forwarΣ o≥á backwarΣá onσ ìèscreen)¼á ╔á maintaineΣ thσ origina∞ ke∙ sequence«á  Bu⌠ iεá man∙ ì
  56. cases¼á thσá blocδá structurσá oµá FORT╚á virtua∞á memor∙á needeΣ ì
  57. operation≤ no⌠ closel∙ analogou≤ t∩ anythinτ iε WordStar«  Rathe≥ ì
  58. thaε risδ confusioε b∙ redefininτ thσ WordSta≥ commanΣ set¼ ╔ pu⌠ ì
  59. al∞á thesσ command≤ oε ß ne≈ menu«á  Sincσ WordSta≥ alread∙á use≤ ì
  60. mos⌠ contro∞ sequences¼ ╔ prefixeΣ thσ ne≈ men⌡ witΦ ^\¼ whicΦ oε ì
  61. thσá Osbornσ keyboarΣ generate≤ aε ASCI╔ 28«á  Fo≥á example¼á ^\╙ ì
  62. wil∞á promp⌠ fo≥ ß screeε numbe≥ anΣ theε movσ directl∙á t∩á tha⌠ ì
  63. screen.
  64.  
  65. Iµá yo⌡ havσ difficult∙ generatinτ aε ASCI╔ 2╕ froφ thσá keyboarΣ ì
  66. iε you≥ system¼ thσ choicσ caε easil∙ bσ changeΣ b∙ modifyinτ thσ ì
  67. worΣá CMENU«á  Iε fact¼á an∙ oµ thσ contro∞ ke∙ sequence≤ caεá bσ ì
  68. redefineΣ b∙ changinτ thσ CAS┼ statement≤ iε CMENU¼á KMENU¼ QMEN╒ ì
  69. o≥á \MENU¼á s∩á t∩ ß fai≥ exten⌠ yo⌡ caε makσ ALTE╥ resemblσá an∙ ì
  70. edito≥ yo⌡ prefer.
  71.  
  72. A≤á iεá WordStar¼á yo⌡ caε choosσ betweeεá inser⌠á anΣá overwritσ ì
  73. modes«  Followinτ thσ convenien⌠ edito≥ provideΣ b∙ Turb∩ Pascal¼ ì
  74. ╔á als∩á provideΣ aε autoinden⌠ modσ tha⌠ caε bσ switcheΣ oεá anΣ ì
  75. off«á  Tab≤ arσ adjustablσ t∩ an∙ fixeΣ value¼ bu⌠ d∩ not linσ u≡ ì
  76. witΦá word≤ oε thσ linσ abovσ a≤ iε thσ Turb∩á editor«á  AlthougΦ ì
  77. prin⌠á formattinτá command≤ arσ no⌠ included¼á ^K╨ wil∞á prin⌠á ß ì
  78. rangσ oµ screen≤ t∩ you≥ lis⌠ device.
  79.  
  80. Search/replacσá anΣá blocδá operation≤ arσ provideΣá iεá somewha⌠ ì
  81. simplifieΣ form«á  Yo⌡ caε search¼á searcΦ witΦ automatiπ replacσ ì
  82. o≥ searcΦ witΦ prompteΣ replace¼ bu⌠ backwarΣ o≥ globa∞ searchinτ ì
  83. anΣ wildcarΣ searche≤ arσ no⌠ implemented«á Blocδ operation≤á arσ ì
  84. limiteΣ t∩ block≤ consistinτ oµ wholσ line≤ anΣ existinτ withiε ß ì
  85. singlσá FORT╚ screen«á  Whilσ thσ Turb∩ edito≥ include≤ ß commanΣ ì
  86. t∩á marδá onσ worΣ a≤ ß block¼á ╔ founΣ i⌠ morσ usefu∞ t∩á adΣá ß ì
  87. commanΣ tha⌠ mark≤ thσ curren⌠ linσ a≤ ß block.
  88.  
  89. Thσá ^▄á men⌡ provide≤ ß numbe≥ oµ command≤á fo≥á conveniencσá iε ì
  90. handlinτá FORT╚á screens«á  ^\╟ wil∞ wipσ thσ curren⌠á screeεá b∙ ì
  91. fillinτá i⌠ witΦ blanks«á  ^\╚ wil∞ restorσ thσ curren⌠ screeε t∩ ì
  92. it≤á statσá beforσ yo⌡ entereΣ it¼á anΣ thu≤ provide≤á ßá wa∙á t∩ ì
  93. recove≥á froφá editinτá mistake≤ s∩ lonτ a≤ yo⌡ d∩á no⌠á leavσá ß ì
  94. screen«  (ALTE╥ flushe≤ eacΦ screeε t∩ disδ wheε yo⌡ leavσ it¼ s∩ ì
  95. yo⌡á caε neve≥ losσ morσ thaε onσ screeε oµ tex⌠ a⌠ ß time.⌐  ^\╥ ì
  96. anΣ ^\╫ allo≈ yo⌡ t∩ reaΣ o≥ writσ betweeε thσ curren⌠ screeε anΣ ì
  97. anothe≥á designateΣá screen¼á whilσ ^\N¼á ^\┘ anΣ ^\┴á allo≈á fo≥ ì
  98. screeε insertion¼ deletioε anΣ swapping.
  99.  
  100. Finally¼á ALTE╥á allow≤á yo⌡ t∩ storσ frequentl∙ useΣá serie≤á oµ ì
  101. command≤ o≥ piece≤ oµ tex⌠ iε macros«á  Wheε ß macr∩ i≤á invoked¼ ì
  102. inpu⌠á i≤ diverteΣ t∩ thσ storeΣ serie≤ oµ keystrokes¼á whicΦ arσ ì
  103. theεá interpreteΣá a≤ thougΦ ALTE╥ werσ receivinτ theφá froφá thσ ì
  104. keyboard«á  U≡ t∩ 1╢ macro≤ caε bσ availablσ a⌠ onσ time«á  Sincσ ì
  105. the∙á arσá storeΣá a≤ thσ 1╢ line≤ oµ ßá FORT╚á screeεá anΣá sucΦ ì
  106. screen≤á caεá bσá reaΣ iε anΣ ou⌠ oµ mas≤ storage¼á therσá i≤á n∩ ì
  107. practica∞ limi⌠ t∩ thσ numbe≥ oµ macro≤ yo⌡ caε kee≡ oε hand.
  108.  
  109. ┴ numbe≥ oµ safeguard≤ arσ buil⌠ int∩ ALTER«á  Numeriπ input≤ arσ ìècheckeΣá fo≥á prope≥á range¼á anΣ strinτ input≤á arσá clippeΣá t∩ ì
  110. acceptablσ length«á GarbleΣ numeriπ input≤ containinτá character≤ ì
  111. othe≥áá thaεá digit≤á wil∞á causσá ALTE╥á t∩á complaiεá unti∞á aε ì
  112. acceptablσá numbe≥á i≤ received«á  Thσá highes⌠á possiblσá screeε ì
  113. numbe≥á fo≥ you≥ systeφ shoulΣ bσ placeΣ iε thσ constan⌠ MAX_SCR¼ ì
  114. anΣá attempt≤á t∩á movσ o≥ writσ beyonΣ MAX_SC╥á wil∞á theεá fai∞ ì
  115. harmlessly«á Attempt≤ t∩ movσ o≥ writσ outsidσ thσ editinτá rangσ ì
  116. citeΣ wheε enterinτ ALTE╥ wil∞ promp⌠ fo≥ confirmation«  
  117.  
  118. SOME COMMENTS ON THE PROGRAM
  119.  
  120. Afte≥á usinτá thσá MV╨ FORT╚ linσ edito≥á t∩á writσá thσá prograφ ì
  121. skeletoεá anΣá ßá fe≈ ke∙ word≤ fo≥á curso≥á movement¼á characte≥ ì
  122. insertioε anΣ screeε refresh¼á ╔ haΣ ß primitivσ versioε oµ ALTE╥ ì
  123. tha⌠ coulΣ bσ useΣ t∩ finisΦ writinτ itself«  Onσ benefi⌠ oµ thi≤ ì
  124. approacΦá wa≤ tha⌠ mos⌠ debugginτ haΣ t∩ bσá accomplisheΣá beforσ ì
  125. thσ sourcσ codσ wa≤ finished«  
  126.  
  127. Everythinτá wa≤ writteε iε straigh⌠ FORT╚ a⌠ first¼á anΣ thσ onl∙ ì
  128. functioεá tha⌠á seemeΣá to∩ slo≈ oεá completioεá wa≤á thσá searcΦ ì
  129. command«á  Rewritinτá onσ lo≈ leve∞ worΣ iε Z8░ assembl∙ languagσ ì
  130. brough⌠ thi≤ u≡ t∩ adequatσ speed«á  Sincσ no⌠ everyonσ ma∙á havσ ì
  131. acces≤á t∩ ß FORT╚ assemble≥ (anΣ sincσ ╔ havσ stil∞ no⌠á learneΣ ì
  132. t∩á usσá thσá onσá iε m∙ possession)¼á thσ codσá worΣá i≤á pieceΣ ì
  133. togethe≥ bytσ b∙ bytσ oε onσ oµ thσ sourcσ screens«  ┴ higΦ leve∞ ì
  134. FORT╚á versioεá i≤á als∩ provideΣ fo≥ temporar∙á usσá oεá non-Z8░ ì
  135. systems.
  136.  
  137. Mos⌠ oµ thσ FORT╚ codσ i≤ simple¼á anΣ migh⌠ havσ beeε donσá morσ ì
  138. subtl∙á o≥á efficientl∙ b∙ aε experienceΣ FORT╚á programmer«á  M∙ ì
  139. firs⌠á aiφá wa≤ t∩ writσ word≤ tha⌠ workeΣ correctl∙á witΦá name≤ ì
  140. tha⌠á suggesteΣ thei≥ functions¼á anΣ ╔ trieΣ t∩ usσá indentatioε ì
  141. anΣ spacinτ iε ß wa∙ tha⌠ woulΣ makσ thσ codσ eas∙ t∩ read«  
  142.  
  143. Thσ organizatioε oµ thσ prograφ i≤ als∩ simple« Thσ corσ i≤ showε ì
  144. iε listinτ 1«  Wheε yo⌡ typσ SCR▒ SCR▓ ALTER¼ thσ worΣ SET_BOUND╙ ì
  145. define≤á thσá editinτ rangσ accordinτ t∩ thσá tw∩á stacδá values«  ì
  146. GREETIN╟á theεá print≤á thσ log-oεá message¼á anΣá thσá remaininτ ì
  147. function≤á oµ ALTE╥ arσ performeΣ b∙ AL«á  A╠ call≤ oεá GET_READ┘ ì
  148. fo≥ somσ initializatioε anΣ theε enter≤ ß loo≡ tha⌠ repeat≤ unti∞ ì
  149. usσ oµ thσ ^K─ commanΣ set≤ aε exi⌠ flag«á  Thσ loo≡ bod∙ i≤ jus⌠ ì
  150. threσá words║á  KEY¼á whicΦá get≤á aε inpu⌠á characte≥á froφá thσ ì
  151. keyboard╗á MENU¼á whicΦá interpret≤ thσ character╗á anΣá REFRESH¼ ì
  152. whicΦ redraw≤ thσ memor∙ mappeΣ vide∩ screeε wheε required.
  153.  
  154. MEN╒á i≤ thσ hear⌠ oµ thσ editor¼á anΣ it≤ onl∙ joΓ i≤ t∩á decidσ ì
  155. whethe≥ thσ inpu⌠ characte≥ i≤ ß contro∞ characte≥ o≥ ß characte≥ ì
  156. oµá text«á  Iµá i⌠ i≤ ß contro∞ character¼á MEN╒ passe≤ i⌠ oεá t∩ ì
  157. ß largσ CAS┼ statemen⌠ iε CMENU¼á whicΦ eithe≥ take≤á appropriatσ ì
  158. actioε o≥ call≤ onσ oµ thσ submenu≤ KMENU¼á QMEN╒ anΣ \MENU«á  Iµ ì
  159. i⌠á i≤á aε ordinar∙ character¼á MEN╒ passe≤ i⌠ t∩á DO_CHA╥, whicΦ ì
  160. eithe≥á insert≤ i⌠ o≥ overwrite≤ i⌠ a⌠ thσ curso≥ position«á  Thσ ì
  161. men⌡á structurσá make≤ ALTE╥ eas∙ t∩ extend«á  Iµ yo⌡á wan⌠á morσ ì
  162. functions¼á jus⌠á writσ word≤ t∩ carr∙ theφ ou⌠ anΣá inser⌠á theφ ì
  163. int∩ thσ appropriatσ menu.è
  164. Thσá word≤á calleΣ b∙ thσ fou≥ menu≤ perforφ thσ actua∞á worδá oµ ì
  165. updatinτá memor∙á anΣ movinτ thσ cursor¼á bu⌠ d∩ nothinτá t∩á thσ ì
  166. vide∩ display«á  Instead¼á the∙ se⌠ flag≤ t∩ tel∞ REFRES╚ whethe≥ ì
  167. i⌠ need≤ t∩ redra≈ thσ wholσ screeε o≥ jus⌠ thσ curren⌠ line¼ anΣ ì
  168. whethe≥ thσ statu≤ linσ shoulΣ als∩ bσ updated«á  Thi≤ i≤ simple≥ ì
  169. thaε havinτ eacΦ worΣ d∩ it≤ owε displa∙ update¼ anΣ ensure≤ tha⌠ ì
  170. eveεá comple°á operation≤ wil∞ no⌠ redra≈ thσá screeεá morσá thaε ì
  171. once.
  172.  
  173. Thosσá wh∩á arσá no⌠á familia≥á witΦ Le∩á Brodie'≤á DOE╥á »á MAK┼ ì
  174. constructioε ma∙ enjo∙ seeinτ ho≈ thesσ word≤ arσ useΣ iεá ALTER« ì
  175. DOE╥á i≤á ß defininτ worΣ useΣ t∩ creatσ placeholde≥á word≤á tha⌠ ì
  176. initiall∙á d∩á nothing«á  Later¼á thσá worΣ MAK┼á caεá definσá o≥ ì
  177. redefinσ thσ actioε tha⌠ wil∞ takσ placσ wheε sucΦ  ß placeholde≥ ì
  178. i≤ encountered«  
  179.  
  180. Aεá examplσ froφ thσ sourcσ codσ oµ ALTE╥ i≤ showε iε Listinτá 2«  ì
  181. Thσ worΣ GET_VALID_NUMBE╥ i≤ useΣ b∙ word≤ tha⌠ neeΣ t∩ receivσ ß ì
  182. numbe≥á withiε somσ acceptablσ range«á  Sincσ thi≤ rangσá ma∙á bσ ì
  183. differen⌠á fo≥á eacΦ case¼á DOE╥ i≤ useΣ t∩ creatσá OKAY?¼á whicΦ ì
  184. fill≤á thσ placσ oµ thσ rangσ specification«á  EacΦ highe≥á leve∞ ì
  185. worΣá sucΦá a≤á GET_SCREE╬á o≥ SELECT_MACR╧á theεá use≤á MAK┼á t∩ ì
  186. definσ OKAY┐ a≤ ß specifiπ rangσ beforσ callinτ GET_VALID_NUMBER.
  187.  
  188. Morσ example≤ oµ DOE╥ » MAK┼ arσ showε iε Listinτ 3« Wheε ß macr∩ ì
  189. i≤á invoked¼á thσá worΣ DO_MACR╧ get≤ character≤ froφ thσá storeΣ ì
  190. macr∩á definitioεá anΣ interpret≤ theφ a≤ iµ the∙ camσá froφá thσ ì
  191. keyboard«á  Iεá orde≥ t∩ d∩ this¼á DO_MACR╧ need≤ t∩ cal∞ oεá thσ ì
  192. worΣá MENU¼á whicΦá interpret≤á al∞á characte≥á input«á  However¼ ì
  193. DO_MACR╧ itselµ i≤ ß worΣ calleΣ indirectl∙ b∙ MENU¼á s∩ therσ i≤ ì
  194. ß probleφ iε defininτ eithe≥ worΣ beforσ thσ other«á  Thσá answe≥ ì
  195. i≤ t∩ havσ DO_MACR╧ cal∞ thσ placeholde≥ MENU'¼á createΣ b∙ DOER«  ì
  196. Later¼á wheε MEN╒ ha≤ beeε defined¼ wσ sa∙ MAK┼ MENUº MENU¼ whicΦ ì
  197. complete≤ thσ forwarΣ reference«  
  198.  
  199. A≤ ß fina∞ example¼ KEYº normall∙ default≤ t∩ thσ FORT╚ primitivσ ì
  200. KEY¼á whicΦá get≤ aε inpu⌠ characte≥ froφ thσá keyboard«á  Durinτ ì
  201. macr∩ execution¼á KEYº change≤ t∩ MACRO@¼á s∩ tha⌠ thσ men⌡ word≤ ì
  202. tha⌠ cal∞ oε KEYº wil∞ insteaΣ obtaiε character≤ froφ thσá storeΣ ì
  203. macr∩ sequence.
  204.  
  205. ALTE╥á wa≤á writteε fo≥ aε Osbornσ ▒ compute≥ anΣá ha≤á no⌠á beeε ì
  206. testeΣá oε anythinτ else«á  However¼á i⌠ shoulΣ bσ fairl∙ eas∙ t∩ ì
  207. adap⌠á t∩á an∙á systeφ witΦ memor∙á mappeΣá video«á  Al∞á Osbornσ ì
  208. specifiπá addresse≤á havσ beeε isolateΣ iε nameΣá constants¼á anΣ ì
  209. definition≤á tha⌠á ma∙ neeΣ adjustmen⌠ arσ flaggeΣ iε thσá sourcσ ì
  210. codσ witΦ thσ commen⌠ ¿ ?PORTABL┼ )«á  ╔ hopσ tha⌠ ALTE╥ wil∞á bσ ì
  211. porteΣ t∩ othe≥ systems¼ anΣ ╔ wil∞ bσ interesteΣ iε hearinτ froφ ì
  212. anyonσ wh∩ succeed≤ iε this.
  213.  
  214. FORT╚á user≤á havσ benefiteΣ greatl∙ froφ generou≤ publiπá domaiε ì
  215. contributions¼ includinτ severa∞ version≤ oµ thσ languagσ itself«  ì
  216. ALTE╥ i≤ ß les≤ ambitiou≤ effort¼á bu⌠ ╔ hopσ tha⌠ it≤ similarit∙ ì
  217. t∩á ßá popula≥á ful∞á screeε edito≥á wil∞á increasσá thσá fuεá oµ ìèprogramminτá iε FORTH«á Thσ prograφ anΣ it≤ supportinτ file≤á arσ ì
  218. availablσ oε thσ Compute≥ Languagσ bulletiε board«á  ALTE╥ ma∙ bσ ì
  219. copieΣá anΣá modifieΣá fo≥ persona∞ use¼á anΣ ╔ looδá forwarΣá t∩ ì
  220. improvement≤ anΣ extension≤ b∙ thosσ wh∩ usσ it.
  221.  
  222.  
  223. Listing 1
  224.  
  225. : REFRESH
  226.   SCREEN_FLAG @ IF   REFRESH_SCREEN   ELSE
  227.   LINE_FLAG @ IF     REFRESH_LINE     THEN THEN
  228.   STATUS_FLAG @ IF   REFRESH_STATUS   THEN
  229.   REFRESH_CURSOR   PROMPT ;
  230.  
  231. (later in source code)
  232.  
  233. : MENU    ( CHAR -- )
  234.   DUP CONTROL?   IF CMENU   ELSE DO_CHAR THEN ;
  235.  
  236. (later in source code)
  237.  
  238. : AL
  239.   GET_READY
  240.   BEGIN   EXIT_FLAG @ 0= WHILE   KEY MENU REFRESH REPEAT ;
  241.  
  242. : ALTER
  243.   SET_BOUNDS   GREETING   AL ;
  244.  
  245.  
  246. Listing 2
  247.  
  248. DOER OKAY?
  249.  
  250. : GET_VALID_NUMBER    ( -- N )
  251.   BEGIN
  252.     GET_NUMBER   DUP OKAY?
  253.   NOT WHILE
  254.     DROP   PROMPT ." OUT OF RANGE.  TRY AGAIN:  "
  255.   REPEAT ;
  256.  
  257. (later in source code)
  258.  
  259. : GET_SCREEN    ( -- N )
  260.   MAKE OKAY?   0 MAX_SCR WITHIN?   ;AND   GET_VALID_NUMBER ;
  261.  
  262. : SELECT_MACRO
  263.   MAKE OKAY?   0 15 WITHIN?   ;AND
  264.   LOAD_MACROS   PROMPT ." MACRO NUMBER (0 - 15):  "
  265.   GET_VALID_NUMBER   MACRO# !   PLUG ;
  266.  
  267.  
  268. Listing 3
  269.  
  270. DOER MENU'
  271. DOER KEY'è
  272. MAKE KEY' KEY ;    SMUDGE
  273.  
  274. : DO_MACRO
  275.   MACRO# @   0 15 WITHIN? NOT IF   SELECT_MACRO THEN
  276.   MAKE KEY' MACRO@   ;AND   RESET_MACRO
  277.   BEGIN   MACRO@ ?DUP WHILE   MENU' REFRESH REPEAT
  278.   MAKE KEY' KEY ;
  279.  
  280. (later in source code)
  281.  
  282. : KMENU
  283.   KEY' FILTER CASE
  284.   (rest of ^K menu definition) ;
  285.   (KEY' will usually be KEY, but if KMENU was called from
  286.    within DO_MACRO, KEY' will be MACRO@.)
  287.  
  288. : MENU    ( CHAR -- )
  289.   DUP CONTROL?   IF CMENU   ELSE DO_CHAR   THEN ;
  290.   (MENU calls CMENU, which calls \MENU, which calls DO_MACRO)
  291.  
  292. MAKE MENU' MENU ;    SMUDGE